package com.control.qct.businesssteward.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.adapter.InventoryStatisticAdapter;
import com.control.qct.businesssteward.base.BaseActivity;
import com.control.qct.businesssteward.model.InventoryStatisticModel;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 品类库存明细表
 * Created by Administrator on 2017/12/28 0028.
 */

public class TypeInventoryStatisticActivity extends BaseActivity {
    @BindView(R.id.tv_goods_type_name)
    TextView mTvGoodsTypeName;
    @BindView(R.id.rv_type_inventory_statistic)
    RecyclerView mRvTypeInventoryStatistic;

    private String typeName;


    private List<InventoryStatisticModel> mInventoryStatisticModelList;

    public TypeInventoryStatisticActivity() {
        super(R.layout.activity_type_inventory_statistic);
    }

    @Override
    protected void getBundleExtras(Bundle extras) {
        super.getBundleExtras(extras);
        typeName = extras.getString("type_name");
    }

    @Override
    protected void initView() {
        setLeftIcon(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        setTitle("品类库存明细表");
        setInventoryStatisticBeanList();
        mTvGoodsTypeName.setText(typeName);
        mRvTypeInventoryStatistic.setLayoutManager(new LinearLayoutManager(this));
        mRvTypeInventoryStatistic.setAdapter(new InventoryStatisticAdapter(mInventoryStatisticModelList));
    }

    public void setInventoryStatisticBeanList() {
        mInventoryStatisticModelList = new ArrayList<>();
        mInventoryStatisticModelList.add(new InventoryStatisticModel("苹果", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("栗子", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("菠萝", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("葡萄", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("橘子", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("金桔", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("芦柑", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("西瓜", 51, 66));
        mInventoryStatisticModelList.add(new InventoryStatisticModel("梨子", 51, 66));
    }
}
